<%#*Encoding.default-internal = "UTF-8";%>
<%= javascript_include_tag "application" %>


<%= form_for @request_and_complaint_complaint, :html => { :multipart => true }  do |f| %>

  <% if @request_and_complaint_complaint.errors.any? %>
    <div id="error_explanation">
      <h2><%= pluralize(@request_and_complaint_complaint.errors.count, "error") %> prohibited this request_and_complaint_complaint from being saved:</h2>

      <ul>
        <% @request_and_complaint_complaint.errors.full_messages.each do |msg| %>
          <li><%= msg %></li>
        <% end %>
      </ul>
    </div>
  <% end %>
 <br />
 <div class="shadow">
 <fieldset id="agrupacion" >

    <legend>Datos de Usuario </legend>

    <fieldset class="column-right" >

 <div class="field">
   <label>Nombre (*)</label><br />
    <%= f.text_field :name %>
  </div>

    <div class="field">
    <label>DNI (*)</label><br />
    <%= f.text_field :dni %>
  </div>
       </fieldset>
<fieldset class="column-left">

    <div class="field">
    <label>E-Mail (*)</label><br />
    <%= f.text_field :email %>

  </div><div class="field">
    <label>Telefono</label><br />
    <%= f.text_field :phone %>
  </div>
 </fieldset>
  </fieldset>

 <fieldset id="agrupacion" >
    <legend>Datos de Denuncia </legend>
<fieldset class="column-left" >
  <div class="field">
    <p><label>Tipo de Denuncia (*)</label> <br /><%= f.select :complaint_type,@complaint_types.collect { |t| [t.name,t.id]}, {:include_blank=>"Seleccione"} %> </p>
  </div>

  <div class="field">
    <label>Descripción (*)</label><br />
    <%= f.text_area :description %>
  </div>

    <div class="field">
    <p><label>Departamento</label><br /><%= f.select :department,@departments.collect { |t| [t.name,t.id]}, {:include_blank=>"Seleccione"} %> </p>
  </div>
   <div class="field">
    <label>Imagen</label><br />
    <%= f.file_field :avatar %>
  </div>

  </fieldset>
    <fieldset class="column-right">
  <div id="provinces">
    <%= render :partial=>"provinces" %>
  </div>


  <div class="field">
     <label>Dirección (*)</label><br />
    <%= f.text_area :address %>
  </div>
 </fieldset>
 

  </fieldset>

  <div class="actions">
    <%= f.submit "Enviar",:class=> 'button', :onclick => "return confirm('¿Está seguro que desea grabar?' )" %>
  </div>
</div>
<% end %>
